﻿Imports lbGlobalcom
Public Class fListaGastos
    Private lNumero As Integer
    Private lTipo As String
    Public ReadOnly Property mNumero() As Integer
        Get
            Return lNumero
        End Get
    End Property
    Public ReadOnly Property mTipo() As String
        Get
            Return lTipo
        End Get
    End Property

    Private Sub btnConsulta_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConsulta.Click
        Try
            Dim daGas As New dsCajaTableAdapters.CAJ_GASTOTableAdapter
            DsCaja.CAJ_GASTO.Rows.Clear()
            daGas.FillByIdTipoDocFechas(DsCaja.CAJ_GASTO, cbTipoGasto.SelectedValue, dtDesdeF.Value.Date, dtHastaF.Value.Date, CustomPrincipal.IdCaja)
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub

    Private Sub fListaGastos_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            Dim daTipoGas As New dsCajaTableAdapters.CAJ_TIPOGASTOTableAdapter
            daTipoGas.Fill(DsCaja.CAJ_TIPOGASTO)
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub

    Private Sub CAR_GASTODataGridView_CellDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles CAR_GASTODataGridView.CellDoubleClick
        Try
            If CAR_GASTODataGridView.CurrentRow IsNot Nothing Then
                lTipo = CAR_GASTODataGridView.CurrentRow.Cells("IDDOCUMENTO").Value
                lNumero = CAR_GASTODataGridView.CurrentRow.Cells("NUMERO").Value
                Me.DialogResult = Windows.Forms.DialogResult.OK
            End If
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
        
    End Sub
End Class